package com.tnsw.facebookautoliker.base;

import com.tnsw.coreutils.MyLog;
import com.tnsw.coreutils.database.DBActionListener;
import com.tnsw.facebookautoliker.database.DBManager;
import com.tnsw.facebookautoliker.helper.FacebookActionListener;
import com.tnsw.facebookautoliker.helper.FacebookBGManager;

import android.app.Activity;

public class ActivityBase extends Activity {
	
	protected String tag = "ActivityBase";
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		MyLog.d(tag, "onDestroy()");
		
		FacebookBGManager fbm = FacebookBGManager.getInstance(null);
		if (fbm != null) {
			if (this instanceof FacebookActionListener) {
				fbm.unregisterActionListener((FacebookActionListener) this);	
			}
				
		}
		
		DBManager dbm = DBManager.getInstance(null);
		if (dbm != null) {
			if (this instanceof DBActionListener) {
				dbm.unregisterActionListener((DBActionListener) this);
			}
		}
	}
}
